/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 * No deletion without permission, or be held responsible to law.
 * @author YDZ
 */
import { defHttp } from '/@/utils/http/axios';
import { useGlobSetting } from '/@/hooks/setting';
import { BasicModel, Page } from '../model/baseModel';
import { UploadApiResult } from '../sys/upload';
import { UploadFileParams } from '/#/axios';

const { ctxPath, adminPath } = useGlobSetting();

export interface visualKkScPlan extends BasicModel<visualKkScPlan> {
  invCode?: string; // 存货编码
  invName?: string; // 存货名称
  workshop?: string; // 车间
  iqty?: string; // 数量
  planDate?: string; // 导入日期
}

export const visualKkScPlanList = (params?: visualKkScPlan | any) =>
  defHttp.get<visualKkScPlan>({ url: adminPath + '/mesvisual/plan/visualKkScPlan/list', params });

export const visualKkScPlanListData = (params?: visualKkScPlan | any) =>
  defHttp.post<Page<visualKkScPlan>>({
    url: adminPath + '/mesvisual/plan/visualKkScPlan/listData',
    params,
  });

export const visualKkScPlanForm = (params?: visualKkScPlan | any) =>
  defHttp.get<visualKkScPlan>({ url: adminPath + '/mesvisual/plan/visualKkScPlan/form', params });

export const visualKkScPlanSave = (params?: any, data?: visualKkScPlan | any) =>
  defHttp.postJson<visualKkScPlan>({
    url: adminPath + '/mesvisual/plan/visualKkScPlan/save',
    params,
    data,
  });

export const visualKkScPlanImportData = (
  params: UploadFileParams,
  onUploadProgress: (progressEvent: ProgressEvent) => void,
) =>
  defHttp.uploadFile<UploadApiResult>(
    {
      url: ctxPath + adminPath + '/mesvisual/plan/visualKkScPlan/importData',
      onUploadProgress,
    },
    params,
  );

export const visualKkScPlanDelete = (params?: visualKkScPlan | any) =>
  defHttp.get<visualKkScPlan>({ url: adminPath + '/mesvisual/plan/visualKkScPlan/delete', params });
